package pl.ppsoft.fixlang;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.widget.TabHost;
import android.widget.TextView;

public class FixLangActivity extends TabActivity {	

	public static final String MODIFY_PREFERENCE_FLAG = "modify_preference_flag";
	public static final String MODIFY_HISTORY_FLAG = "modify_history_flag";
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

        PreferenceManager.setDefaultValues(this, R.xml.lesson_preferences, false);

	    TabHost tabHost = getTabHost();	    
	    TabHost.TabSpec spec;
	    Intent intent;
	    TextView view;
	    
	    view = (TextView)LayoutInflater.from(this).inflate(R.layout.tab_view, null);
	    view.setText( R.string.tab_learn );
	    intent = new Intent().setClass(this, LessonsActivity.class);
	    spec = tabHost.newTabSpec("learn").setIndicator(view).setContent(intent);
	    tabHost.addTab(spec);

	    view = (TextView)LayoutInflater.from(this).inflate(R.layout.tab_view, null);
	    view.setText( R.string.tab_history );
	    intent = new Intent().setClass(this, HistoryActivity.class);
	    spec = tabHost.newTabSpec("history").setIndicator(view).setContent(intent);
	    tabHost.addTab(spec);

	    view = (TextView)LayoutInflater.from(this).inflate(R.layout.tab_view, null);
	    view.setText( R.string.tab_manager );
	    intent = new Intent().setClass(this, LessonsManagerActivity.class);
	    spec = tabHost.newTabSpec("manager").setIndicator(view).setContent(intent);
	    tabHost.addTab(spec);

	    tabHost.setCurrentTab(0);
	}
}
